package com.ruoyi.know.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.domain.entity.SysUser;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.springframework.boot.context.properties.bind.DefaultValue;

/**
 * 社区帖子对象 community_posts
 *
 * @author ruoyi
 * @date 2025-02-10
 */
public class CommunityPosts extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 帖子id */
    private Long postId;

    /** 所属板块id */
    @Excel(name = "所属板块id")
    private Long sectionId;

    private String sectionName;

    /** 发帖用户 */
    @Excel(name = "发帖用户")
    private Long userId;

    //  用户信息
    private SysUser user;

    private String nickName;

    //点赞数量
    private Integer likeNum;

    /**
     * 是否已经点赞
     */
    private boolean isLike;

    /**
     * 是否已关注该用户
     */
    private boolean focused;

    /** 帖子标题 */
    @Excel(name = "帖子标题")
    private String postTitle;

    /** 帖子内容 */
    private String postContent;

    /** 浏览量 */
    private int visitQuantity;

    /** 是否有效：0无效1有效 */
    private Long isValid;

    /** 创建人 */
    private String createdBy;

    /** 创建时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createdAt;

    /** 更新时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updatedAt;

    public void setPostId(Long postId)
    {
        this.postId = postId;
    }

    public Long getPostId()
    {
        return postId;
    }
    public void setSectionId(Long sectionId)
    {
        this.sectionId = sectionId;
    }

    public Long getSectionId()
    {
        return sectionId;
    }

    public String getSectionName() {
        return sectionName;
    }

    public void setSectionName(String sectionName) {
        this.sectionName = sectionName;
    }

    public void setUserId(Long userId)
    {
        this.userId = userId;
    }

    public Long getUserId()
    {
        return userId;
    }

    public SysUser getUser() {
        return user;
    }
    public void setUser(SysUser user) {
        this.user = user;
    }

    public void setPostTitle(String postTitle)
    {
        this.postTitle = postTitle;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getPostTitle()
    {
        return postTitle;
    }
    public void setPostContent(String postContent)
    {
        this.postContent = postContent;
    }

    public String getPostContent()
    {
        return postContent;
    }
    public void setIsValid(Long isValid)
    {
        this.isValid = isValid;
    }

    public Long getIsValid()
    {
        return isValid;
    }
    public void setCreatedBy(String createdBy)
    {
        this.createdBy = createdBy;
    }

    public String getCreatedBy()
    {
        return createdBy;
    }
    public void setCreatedAt(Date createdAt)
    {
        this.createdAt = createdAt;
    }

    public Date getCreatedAt()
    {
        return createdAt;
    }
    public void setUpdatedAt(Date updatedAt)
    {
        this.updatedAt = updatedAt;
    }

    public Date getUpdatedAt()
    {
        return updatedAt;
    }

    public Integer getLikeNum() {
        return likeNum;
    }

    public void setLikeNum(Integer likeNum) {
        this.likeNum = likeNum;
    }

    public boolean isLike() {
        return isLike;
    }

    public boolean isFocused() {
        return focused;
    }

    public void setFocused(boolean focused) {
        this.focused = focused;
    }

    public void setLike(boolean like) {
        isLike = like;
    }

    public int getVisitQuantity() {
        return visitQuantity;
    }

    public void setVisitQuantity(int visitQuantity) {
        this.visitQuantity = visitQuantity;
    }

    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("postId", getPostId())
            .append("sectionId", getSectionId())
            .append("userId", getUserId())
            .append("getNickName",getNickName())
            .append("postTitle", getPostTitle())
            .append("postContent", getPostContent())
            .append("isValid", getIsValid())
            .append("isLike",isLike())
            .append("getLikeNum",getLikeNum())
            .append("focused",isFocused())
            .append("createdBy", getCreatedBy())
            .append("createdAt", getCreatedAt())
            .append("updateBy", getUpdateBy())
            .append("updatedAt", getUpdatedAt())
            .toString();
    }
}
